
//
//  UIView + Extension.swift
//  microBlog
//
//  Created by apple on 16/4/16.
//  Copyright © 2016年 Hill. All rights reserved.
//

import UIKit

extension UIView {
    
    @IBInspectable var boardWidth: CGFloat {
        
        get{
           
            return self.layer.borderWidth
        
        }
        set{
            
            self.layer.borderWidth = newValue
        
        }
    }
    
    
    @IBInspectable var boardColor: UIColor? {
       
        get{
            
            if let bc = self.layer.borderColor {
                
                return UIColor(CGColor: bc)
                
            }
            
            return nil
        }
        set{
            
            self.layer.borderColor = newValue?.CGColor
        }
    }
    
    
    @IBInspectable var cornerRadius: CGFloat {
        
        get{
            
            return self.layer.cornerRadius
            
        }
        set{
            
            self.layer.cornerRadius = newValue
            self.layer.masksToBounds = (newValue > 0)
            
        }
        
    }
    
}


